home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Blender 2.49b / blender-2.49b-windows.exe / $_4_ / .blender / scripts / flt_properties.py < prev    next >
Text File  |  2009-08-31  |  14KB  |  631 lines

  1. # flt_properties.py. For setting default OpenFLight ID property types
  2. # Copyright (C) 2007 Blender Foundation
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License
  6. # as published by the Free Software Foundation; either version 2
  7. # of the License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  17.  
  18. __bpydoc__ ="""\
  19. Utility functions and data defintions used by OpenFlight I/O and tool scripts. OpenFlight is a
  20. registered trademark of MultiGen-Paradigm, Inc.
  21. """
  22.  
  23.  
  24. import struct 
  25.  
  26. bitsLSB = [2147483648]
  27. for i in xrange(31):
  28.     bitsLSB.append(bitsLSB[-1]/2)
  29. bitsRSB = bitsLSB[:]
  30. bitsRSB.reverse()
  31.  
  32. def pack_color(col):
  33.     return struct.pack('>B',col[3]) + struct.pack('>B',col[2]) + struct.pack('>B',col[1]) + struct.pack('>B',col[0])
  34.     
  35. def unpack_color(col):
  36.     string = struct.pack('>I', col)
  37.     r = struct.unpack('>B',string[3:4])
  38.     g = struct.unpack('>B',string[2:3])
  39.     b = struct.unpack('>B',string[1:2])
  40.     a = struct.unpack('>B',string[0:1])
  41.     return [r,g,b,a] 
  42.  
  43. def reverse_bits(len,num):
  44.     bitbucket = list()
  45.     rval = 0
  46.     
  47.     for i in xrange(len):
  48.         if num & bitsRSB[i]:
  49.             bitbucket.append(1)
  50.         else:
  51.             bitbucket.append(0)
  52.     
  53.     bitbucket.reverse()
  54.     
  55.     for i, bit in enumerate(bitbucket):
  56.         if bit:
  57.             rval |= bitsLSB[i]
  58.     
  59.     return rval
  60.     
  61.     
  62. opcode_name = { 0: 'db',
  63.                 1: 'head',
  64.                 2: 'grp',
  65.                 4: 'obj',
  66.                 5: 'face',
  67.                 10: 'push',
  68.                 11: 'pop',
  69.                 14: 'dof',
  70.                 19: 'push sub',
  71.                 20: 'pop sub',
  72.                 21: 'push ext',
  73.                 22: 'pop ext',
  74.                 23: 'cont',
  75.                 31: 'comment',
  76.                 32: 'color pal',
  77.                 33: 'long id',
  78.                 49: 'matrix',
  79.                 50: 'vector',
  80.                 52: 'multi-tex',
  81.                 53: 'uv lst',
  82.                 55: 'bsp',
  83.                 60: 'rep',
  84.                 61: 'inst ref',
  85.                 62: 'inst def',
  86.                 63: 'ext ref',
  87.                 64: 'tex pal',
  88.                 67: 'vert pal',
  89.                 68: 'vert w col',
  90.                 69: 'vert w col & norm',
  91.                 70: 'vert w col, norm & uv',
  92.                 71: 'vert w col & uv',
  93.                 72: 'vert lst',
  94.                 73: 'lod',
  95.                 74: 'bndin box',
  96.                 76: 'rot edge',
  97.                 78: 'trans',
  98.                 79: 'scl',
  99.                 80: 'rot pnt',
  100.                 81: 'rot and/or scale pnt',
  101.                 82: 'put',
  102.                 83: 'eyepoint & trackplane pal',
  103.                 84: 'mesh',
  104.                 85: 'local vert pool',
  105.                 86: 'mesh prim',
  106.                 87: 'road seg',
  107.                 88: 'road zone',
  108.                 89: 'morph vert lst',
  109.                 90: 'link pal',
  110.                 91: 'snd',
  111.                 92: 'rd path',
  112.                 93: 'snd pal',
  113.                 94: 'gen matrix',
  114.                 95: 'txt',
  115.                 96: 'sw',
  116.                 97: 'line styl pal',
  117.                 98: 'clip reg',
  118.                 100: 'ext',
  119.                 101: 'light src',
  120.                 102: 'light src pal',
  121.                 103: 'reserved',
  122.                 104: 'reserved',
  123.                 105: 'bndin sph',
  124.                 106: 'bndin cyl',
  125.                 107: 'bndin hull',
  126.                 108: 'bndin vol cntr',
  127.                 109: 'bndin vol orient',
  128.                 110: 'rsrvd',
  129.                 111: 'light pnt',
  130.                 112: 'tex map pal',
  131.                 113: 'mat pal',
  132.                 114: 'name tab',
  133.                 115: 'cat',
  134.                 116: 'cat dat',
  135.                 117: 'rsrvd',
  136.                 118: 'rsrvd',
  137.                 119: 'bounding hist',
  138.                 120: 'rsrvd',
  139.                 121: 'rsrvd',
  140.                 122: 'push attrib',
  141.                 123: 'pop attrib',
  142.                 124: 'rsrvd',
  143.                 125: 'rsrvd',
  144.                 126: 'curv',
  145.                 127: 'road const',
  146.                 128: 'light pnt appear pal',
  147.                 129: 'light pnt anim pal',
  148.                 130: 'indexed lp',
  149.                 131: 'lp sys',
  150.                 132: 'indx str',
  151.                 133: 'shdr pal'}
  152.  
  153.  
  154. typecodes = ['c','C','s','S','i','I','f','d','t']
  155.  
  156. FLT_GRP =    2
  157. FLT_OBJ =    4
  158. FLT_LOD =    73
  159. FLT_XRF =    63
  160. FLT_DOF =    14
  161. FLT_ILP =    111
  162. FLT_DB =    1
  163. FLT_FCE =    5
  164.  
  165. #not actual opcodes
  166. FLT_NUL =    0
  167. FLT_EXP =    -1
  168.  
  169. #valid childtypes for each FLT node type
  170. FLT_CHILDTYPES = { 
  171.     FLT_GRP : [111,2,73,4,14,63],
  172.     FLT_OBJ : [111],
  173.     FLT_LOD : [111,2,73,4,14,63],
  174.     FLT_XRF : [],
  175.     FLT_DOF : [111,2,73,4,14,63],
  176.     FLT_ILP : []
  177. }
  178.  
  179. #List of nodes that can have faces as children
  180. FLT_FACETYPES = [
  181.     FLT_GRP,
  182.     FLT_OBJ,
  183.     FLT_LOD,
  184.     FLT_DOF
  185. ]
  186.  
  187. def write_prop(fw,type,value,length):
  188.     if type == 'c':
  189.         fw.write_char(value)
  190.     elif type == 'C':
  191.         fw.write_uchar(value)
  192.     elif type == 's':
  193.         fw.write_short(value)
  194.     elif type == 'S':
  195.         fw.write_ushort(value)
  196.     elif type == 'i':
  197.         fw.write_int(value)
  198.     elif type == 'I':
  199.         #NOTE!:
  200.         #there is no unsigned int type in python, but we can only store signed ints in ID props
  201.         newvalue = struct.unpack('>I', struct.pack('>i', value))[0]
  202.         fw.write_uint(newvalue)
  203.     elif type == 'd':
  204.         fw.write_double(value)
  205.     elif type == 'f':
  206.         fw.write_float(value)
  207.     elif type == 't':
  208.         fw.write_string(value,length)
  209.  
  210. def read_prop(fw,type,length):
  211.     rval = None
  212.     if type == 'c':
  213.         rval = fw.read_char()
  214.     elif type == 'C':
  215.         rval = fw.read_uchar()
  216.     elif type == 's':
  217.         rval = fw.read_short()
  218.     elif type == 'S':
  219.         rval = fw.read_ushort()
  220.     elif type == 'i':
  221.         rval = fw.read_int()
  222.     elif type == 'I':
  223.         rval = fw.read_uint()
  224.     elif type == 'd':
  225.         rval = fw.read_double()
  226.     elif type == 'f':
  227.         rval = fw.read_float()
  228.     elif type == 't':
  229.         rval = fw.read_string(length)
  230.     return rval
  231.     
  232.     
  233. FLTExt = {
  234.     '3t8!id' : 'Ext',
  235.     '4t8!sid' : '',
  236.     '5c!reserved': 0,
  237.     '6c!revision' : 0,
  238.     '7S!recordcode' : 0
  239. }
  240. FLTGroup = {
  241.     '3t8!id' : 'G',
  242.     '4s!priority' : 0, 
  243.     '5s!reserved1' : 0, 
  244.     '6i!flags' : 0, 
  245.     '7s!special1' : 0,
  246.     '8s!special2' : 0, 
  247.     '9s!significance' : 0,
  248.     '10c!layer code' : 0,
  249.     '11c!reserved2' : 0,
  250.     '12i!reserved3' : 0,
  251.     '13i!loop count' : 0,
  252.     '14f!loop duration' : 0,
  253.     '15f!last frame duration' : 0
  254. }
  255. FLTGroupDisplay = [5,11,12]
  256.  
  257. FLTObject = {
  258.     '3t8!id' : 'O',
  259.     '4I!flags' : 0,
  260.     '5s!priority' : 0,
  261.     '6S!transp' : 0,
  262.     '7s!SFX1' : 0,
  263.     '8s!SFX2' : 0,
  264.     '9s!significance' : 0,
  265.     '10s!reserved' : 0
  266. }
  267. FLTObjectDisplay = [10]
  268.  
  269. FLTLOD = {
  270.     '3t8!id' : 'L',
  271.     '4i!reserved' : 0,
  272.     '5d!switch in' : 0.0,
  273.     '6d!switch out' : 0.0,
  274.     '7s!sfx ID1' : 0,
  275.     '8s!sfx ID2' : 0,
  276.     '9I!flags' : 0,
  277.     '10d!X co' : 0.0,
  278.     '11d!Y co' : 0.0,
  279.     '12d!Z co' : 0.0,
  280.     '13d!Transition' : 0.0,
  281.     '14d!Sig Size' : 0.0
  282. }
  283. FLTLODDisplay = [4]
  284.  
  285. FLTInlineLP = {
  286.     '3t8!id' : 'Lp',
  287.     '4s!smc' : 0,
  288.     '5s!fid' : 0,
  289.     '6C!back color: a' : 255,
  290.     '7C!back color: b' : 255,
  291.     '8C!back color: g' : 255,
  292.     '9C!back color: r' : 255,
  293.     '10i!display mode' : 0,
  294.     '11f!intensity' : 1.0,
  295.     '12f!back intensity' : 0.0,
  296.     '13f!minimum defocus' : 0.0,
  297.     '14f!maximum defocus' : 1.0,
  298.     '15i!fading mode' : 0,
  299.     '16i!fog punch mode' : 0,
  300.     '17i!directional mode' : 1,
  301.     '18i!range mode' : 0,
  302.     '19f!min pixel size' : 1.0,
  303.     '20f!max pixel size' : 1024,
  304.     '21f!actual size' : 0.25,
  305.     '22f!trans falloff pixel size' : 0.25,
  306.     '23f!trans falloff exponent' : 1.0,
  307.     '24f!trans falloff scalar' : 1.0,
  308.     '25f!trans falloff clamp' : 1.0,
  309.     '26f!fog scalar' : 0.25,
  310.     '27f!fog intensity' : 1.0,
  311.     '28f!size threshold' : 0.1,
  312.     '29i!directionality' : 0,
  313.     '30f!horizontal lobe angle' : 180.0,
  314.     '31f!vertical lobe angle' : 180.0,
  315.     '32f!lobe roll angle' : 0.0,
  316.     '33f!dir falloff exponent' : 1.0,
  317.     '34f!dir ambient intensity' : 0.1,
  318.     '35f!anim period' : 2,
  319.     '36f!anim phase' : 0,
  320.     '37f!anim enabled' : 1.0,
  321.     '38f!significance' : 0.0,
  322.     '39i!draw order' : 0,
  323.     '40I!flags' : 277004288, 
  324.     '41f!roti' : 0,
  325.     '42f!rotj' : 0,
  326.     '43f!rotk' : 1.0
  327. }
  328.  
  329. FLTInlineLPDisplay = [35,36,37,41,42,43]
  330.  
  331. FLTXRef = {
  332.     '3t200!filename' : '', #we dont actually use this value on export
  333.     '4i!reserved' : 0,
  334.     '5I!flag' : -478150656,
  335.     '6s!bbox' : 0,
  336.     '7s!reserved' : 0
  337. }
  338.  
  339. FLTXRefDisplay = [4,7,3]
  340.  
  341. FLTDOF = {
  342.     '3t8!id' : 'D',        
  343.     '4i!reserved' : 0,
  344.     '5d!ORIGX' : 0.0,
  345.     '6d!ORIGY' : 0.0, 
  346.     '7d!ORIGZ' : 0.0,
  347.     '8d!XAXIS-X' : 10.0,
  348.     '9d!XAXIS-Y' : 0.0,
  349.     '10d!XAXIS-Z' : 0.0,
  350.     '11d!XYPLANE-X' : 0.0,
  351.     '12d!XYPLANE-Y' : 10.0,
  352.     '13d!XZPLANE-Z' : 0.0,
  353.     '14d!ZMIN' : 0.0,
  354.     '15d!ZMAX' : 0.0,
  355.     '16d!ZCUR' : 0.0,
  356.     '17d!ZSTEP' : 0.0,
  357.     '18d!YMIN' : 0.0,
  358.     '19d!YMAX' : 0.0,
  359.     '20d!YCUR' : 0.0,
  360.     '21d!YSTEP' : 0.0,
  361.     '22d!XMIN' : 0.0,
  362.     '23d!XMAX' : 0.0,
  363.     '24d!XCUR' : 0.0,
  364.     '25d!XSTEP' : 0.0,
  365.     '26d!PITCH-MIN' : 0.0,
  366.     '27d!PITCH-MAX' : 0.0,
  367.     '28d!PITCH-CUR' : 0.0,
  368.     '29d!PITCH-STEP' : 0.0,
  369.     '30d!ROLL-MIN' : 0.0,
  370.     '31d!ROLL-MAX' : 0.0,
  371.     '32d!ROLL-CUR' : 0.0,
  372.     '33d!ROLL-STEP' : 0.0,
  373.     '34d!YAW-MIN' : 0.0,
  374.     '35d!YAW-MAX' : 0.0,
  375.     '36d!YAW-CUR' : 0.0,
  376.     '37d!YAW-STEP' : 0.0,
  377.     '38d!ZSIZE-MIN' : 0.0,
  378.     '39d!ZSIZE-MAX' : 0.0,
  379.     '40d!ZSIZE-CUR' : 1.0,
  380.     '41d!ZSIZE-STEP' : 0.0,
  381.     '42d!YSIZE-MIN' : 0.0,
  382.     '43d!YSIZE-MAX' : 0.0,
  383.     '44d!YSIZE-CUR' : 1.0,
  384.     '45d!YSIZE-STEP' : 0.0,
  385.     '46d!XSIZE-MIN' : 0.0,
  386.     '47d!XSIZE-MAX' : 0.0,
  387.     '48d!XSIZE-CUR' : 1.0,
  388.     '49d!XSIZE-STEP' : 0.0,
  389.     '50I!FLAG' : 1897582,
  390.     '51i!reserved2' : 0
  391. }
  392.  
  393. FLTDOFDisplay = [4]
  394.  
  395. FLTImage = {
  396.     '3i!RealU Direction' : 0, 
  397.     '4i!RealV Direction' : 0, 
  398.     '5i!UpX' : 0, 
  399.     '6i!UpY' : 0, 
  400.     '7i!File Format' : 0, 
  401.     '8i!Min Filter' : 6, 
  402.     '9i!Mag Filter' : 1, 
  403.     '10i!Wrap' : 0, 
  404.     '11i!WrapU' : 0, 
  405.     '12i!WrapV' : 0, 
  406.     '13i!Modified' : 0,
  407.     '14i!PivotX' : 0, 
  408.     '15i!PivotY' : 0, 
  409.     '16i!Enviorment' : 0, 
  410.     '17i!WhiteAlpha' : 0, 
  411.     '18i!reserved1' : 0,
  412.     '19i!reserved2' : 0,
  413.     '20i!reserved3' : 0,
  414.     '21i!reserved4' : 0,
  415.     '22i!reserved5' : 0,
  416.     '23i!reserved6' : 0,
  417.     '24i!reserved7' : 0,
  418.     '25i!reserved8' : 0,
  419.     '26i!reserved9' : 0,
  420.     '27d!RealU Direction' : 0, 
  421.     '28d!RealV Direction' : 0, 
  422.     '29i!Origin' : 0, 
  423.     '30i!Kernel no.' : 0, 
  424.     '31i!Internal Format' : 0, 
  425.     '32i!External Format' : 0, 
  426.     '33i!MipMap Filter?' : 0, 
  427.     '34f!MMF1' : 0.0, 
  428.     '35f!MMF2' : 0.0, 
  429.     '36f!MMF3' : 0.0, 
  430.     '37f!MMF4' : 0.0, 
  431.     '38f!MMF5' : 0.0, 
  432.     '39f!MMF6' : 0.0, 
  433.     '40f!MMF7' : 0.0, 
  434.     '41f!MMF8' : 0.0, 
  435.     '42i!Tex CPs?' : 0, 
  436.     '43f!LOD0 CP' : 0.0, 
  437.     '44f!Scale0 CP' : 0.0, 
  438.     '45f!LOD1 CP' : 0.0, 
  439.     '46f!Scale1 CP' : 0.0, 
  440.     '47f!LOD2 CP' : 0.0, 
  441.     '48f!Scale2 CP' : 0.0, 
  442.     '49f!LOD3 CP' : 0.0, 
  443.     '50f!Scale3 CP' : 0.0, 
  444.     '51f!LOD4 CP' : 0.0, 
  445.     '52f!Scale4 CP' : 0.0, 
  446.     '53f!LOD5 CP' : 0.0, 
  447.     '54f!Scale5 CP' : 0.0, 
  448.     '55f!LOD6 CP' : 0.0, 
  449.     '56f!Scale6 CP' : 0.0, 
  450.     '57f!LOD7 CP' : 0.0, 
  451.     '58f!Scale7 CP' : 0.0, 
  452.     '59f!Control Clamp' : 0.0, 
  453.     '60i!Mag Alpha Filter' : 0, 
  454.     '61i!Mag Color Filter' : 0, 
  455.     '62f!reserved10' : 0,
  456.     '63f!reserved11' : 0,
  457.     '64f!reserved12' : 0,
  458.     '65f!reserved13' : 0,
  459.     '66f!reserved14' : 0,
  460.     '67f!reserved15' : 0,
  461.     '68f!reserved16' : 0,
  462.     '69f!reserved17' : 0,
  463.     '70f!reserved18' : 0,
  464.     '71d!Lambert Central' : 0.0, 
  465.     '72d!Lambert Upper' : 0.0, 
  466.     '73d!Lambert Lower' : 0.0, 
  467.     '74d!reserved19' : 0,
  468.     '75f!reserved20' : 0,
  469.     '76f!reserved21' : 0,
  470.     '77f!reserved22' : 0,
  471.     '78f!reserved23' : 0,
  472.     '79f!reserved24' : 0,
  473.     '80i!Tex Detail?' : 0, 
  474.     '81i!Tex J' : 0, 
  475.     '82i!Tex K' : 0, 
  476.     '83i!Tex M' : 0, 
  477.     '84i!Tex N' : 0, 
  478.     '85i!Tex Scramble' : 0, 
  479.     '86i!Tex Tile?' : 0, 
  480.     '87f!Tex Tile LLU' : 0.0, 
  481.     '88f!Tex Tile LLV' : 0.0, 
  482.     '89f!Tex Tile URU' : 0.0,
  483.     '90f!Tex Tile URV' : 0.0, 
  484.     '91i!Projection' : 0, 
  485.     '92i!Earth Model' : 0, 
  486.     '93i!reserved25' : 0,
  487.     '94i!UTM Zone' : 0, 
  488.     '95i!Image Origin' : 0,
  489.     '96i!GPU' : 0, 
  490.     '97i!reserved26' : 0,
  491.     '98i!reserved27' : 0,
  492.     '99i!GPU Hemi' : 0, 
  493.     '100i!reserved41' : 0,
  494.     '101i!reserved42' : 0,
  495.     '102i!reserved43' : 0,
  496.     '103i!Cubemap' : 0, 
  497.     '104t588!reserved44' : '',
  498.     '105t512!Comments' : '', 
  499.     '106i!reserved28' : 0,
  500.     '107i!reserved29' : 0,
  501.     '108i!reserved30' : 0,
  502.     '109i!reserved31' : 0,
  503.     '110i!reserved32' : 0,
  504.     '111i!reserved33' : 0,
  505.     '112i!reserved34' : 0,
  506.     '113i!reserved35' : 0,
  507.     '114i!reserved36' : 0,
  508.     '115i!reserved37' : 0,
  509.     '116i!reserved38' : 0,
  510.     '117i!reserved39' : 0,
  511.     '118i!reserved40' : 0,
  512.     '119i!reserved45' : 0,
  513.     '120i!Format Version' : 0, 
  514.     '121i!GPU num' : 0,
  515. }
  516.  
  517. FLTImageDisplay = [18,19,29,21,22,23,24,25,26,62,63,64,65,66,67,68,69,70,74,75,76,77,78,79,93,97,98,102,114]
  518.  
  519. FLTHeader = {
  520.     '3t8!id' : 'db',
  521.     '4i!version' : 1620,
  522.     '5i!editversion' : 0,
  523.     '6t32!date' : 0,
  524.     '7s!NGID' : 0,
  525.     '8s!NLID' : 0,
  526.     '9s!NOID' : 0,
  527.     '10s!NFID' : 0,
  528.     '11s!UMULT' : 1,
  529.     '12c!units' : 0,
  530.     '13c!set white' : 0,
  531.     '14I!flags' : 0x80000000,
  532.     '15i!reserved1' : 0,
  533.     '16i!reserved2' : 0,
  534.     '17i!reserved3' : 0,
  535.     '18i!reserved4' : 0,
  536.     '19i!reserved5' : 0,
  537.     '20i!reserved6' : 0,
  538.     '21i!projection type' : 0,
  539.     '22i!reserved7' : 0,
  540.     '23i!reserved8' : 0,
  541.     '24i!reserved9' : 0,
  542.     '25i!reserved10' : 0,
  543.     '26i!reserved11' : 0,
  544.     '27i!reserved12' : 0,
  545.     '28i!reserved13' : 0,
  546.     '29s!NDID' : 0,
  547.     '30s!vstore' : 1,
  548.     '31i!origin' : 0,
  549.     '32d!sw x' : 0,
  550.     '33d!sw y' : 0,
  551.     '34d!dx' : 0,
  552.     '35d!dy' : 0,
  553.     '36s!NSID' : 0,
  554.     '37s!NPID' : 0,
  555.     '38i!reserved14' : 0,
  556.     '39i!reserved15' : 0,
  557.     '40s!NCID' : 0,
  558.     '41s!NTID' : 0,
  559.     '42s!NBID' : 0,
  560.     '43s!NWID' : 0,
  561.     '44i!reserved14' : 0,
  562.     '45d!sw lat' : 0,
  563.     '46d!sw lon' : 0,
  564.     '47d!ne lat' : 0,
  565.     '48d!ne lon' : 0,
  566.     '49d!origin lat' : 0,
  567.     '50d!origin lon' : 0,
  568.     '51d!lambert lat1' : 0,
  569.     '52d!lambert lat2' : 0,
  570.     '53s!NLSID' : 0,
  571.     '54s!NLPID' : 0,
  572.     '55s!NRID' : 0,
  573.     '56s!NCATID' : 0,
  574.     '57s!reserved15' : 0,
  575.     '58s!reserved16' : 0,
  576.     '59s!reserved17' : 0,
  577.     '60s!reserved18' : 0,
  578.     '61i!ellipsoid model' : 1,
  579.     '62s!NAID' : 0,
  580.     '63s!NCVID' : 0,
  581.     '64s!utm zone' : 0,
  582.     '65t6!reserved19' : 0,
  583.     '66d!dz' : 0,
  584.     '67d!radius' : 0,
  585.     '68S!NMID' : 0,
  586.     '69S!NLPSID' : 0,
  587.     '70i!reserved20' : 0,
  588.     '71d!major axis' : 0,
  589.     '72d!minor axis' : 0,
  590. }
  591.  
  592. FLT_Records = {
  593.         2 : FLTGroup,
  594.         4 : FLTObject,
  595.         73 : FLTLOD,
  596.         63 : FLTXRef,
  597.         14 : FLTDOF,
  598.         1 : FLTHeader,
  599.         111 : FLTInlineLP,
  600.         100 : FLTExt,
  601.         'Image'    : FLTImage
  602. }
  603.  
  604. def process_recordDefs(): 
  605.     records = dict()
  606.     for record in FLT_Records:
  607.         props = dict()
  608.         for prop in FLT_Records[record]:
  609.             position = ''
  610.             slice = 0
  611.             (format,name) = prop.split('!')
  612.             for i in format:
  613.                 if i not in typecodes:
  614.                     position = position + i
  615.                     slice = slice + 1
  616.                 else:
  617.                     break
  618.             type = format[slice:]
  619.             length = type[1:] 
  620.             if len(length) == 0:
  621.                 length = 1
  622.             else:
  623.                 type = type[0]
  624.                 length = int(length)
  625.             
  626.             props[int(position)] = (type,length,prop)
  627.         records[record] = props
  628.     return records
  629.  
  630.  
  631.